package com.accp.restaurant.dao;

import com.accp.restaurant.entity.Sss;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SssDao extends JpaRepository<Sss,Long> {


    @Query(value = "select id, count(hotsale) hotsale,count(distinct `month`) `month`,sum(totalamount) totalamount,alltime from sss group by alltime order by alltime asc limit 0,6 ",nativeQuery = true)
    public List<Sss> findAll();


    @Query(value = "select id, count(hotsale) hotsale,count(distinct `month`) `month`,sum(totalamount) totalamount,alltime from sss group by alltime order by alltime asc limit 6,12 ",nativeQuery = true)
    public List<Sss> findAll1();

    @Query(value = "select id, count(hotsale) hotsale,count(distinct `month`) `month`,sum(totalamount) totalamount,alltime from sss group by alltime order by alltime asc",nativeQuery = true)
    public List<Sss> findAll2();

}
